package visualization.graphkeymodel.circlechart;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Rectangle;


/**
 * 
 * @author Ben Schwab
 * 
 */
public class RelativeCircle {
    private Rectangle myDrawArea;
    private Color myColor;
    private int myRadius;

    /**
     * 
     * @param circleArea area to draw the circle
     * @param color color of the circle
     * @param relativeSize the relative size multiplier to make this circle in proportion to the
     *        circle of max size
     */
    public RelativeCircle (Rectangle circleArea, Color color, double relativeSize) {
        myDrawArea = circleArea;
        myRadius = (int) (Math.min(circleArea.getWidth(), circleArea.getHeight()) * relativeSize);
        myColor = color;
    }

    /**
     * 
     * @param pen current visualization pen
     */
    public void draw (Graphics2D pen) {
        pen.setColor(myColor);
        pen.fillOval((int) myDrawArea.getCenterX() - myRadius / 2, (int) myDrawArea.getCenterY() -
                myRadius / 2, myRadius, myRadius);
    }

}
